!!! 5

%html{:lang => 'en', 'ng-app' => 'sabisu'}
  %head
    %script{:src => 'https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'}
    %script{:src => 'https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js'}
    %script{:src => 'https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.min.js'}
    %script{:src => '/js/sabisu.js'}
    %script{:src => 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js'}
    %script{:src => 'https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js'}
    %link{:rel => 'stylesheet', :href => '/css/bootstrap.min.css'}
    %link{:rel => 'stylesheet', :href => '/css/base.css'}

  %body
    #wrapper.container
      #header
        .nav.navbar.navbar-default{:role => 'navigation'}
          .navbar-header
            %a.navbar-brand{:href => '/'} Sabisu
          %ul.nav.navbar-nav.navbar-right
            - if logged_in?
              %li.dropdown
                %a.droptown-toggle{:href => '#', :target => '_self', 'data-toggle' => 'dropdown'}
                  Events
                  %b.caret
                %ul.dropdown-menu
                  %li
                    %a{:href => '/events?sort=-age&limit=50&query=', :target => '_self'} Recent State Change
                  %li
                    %a{:href => '/events?sort=age&limit=50&query=', :target => '_self'} Stale State
                  %li
                    %a{:href => '/events?sort=-age&limit=50&query=status:1', :target => '_self'} Warning
                  %li
                    %a{:href => '/events?sort=-age&limit=50&query=status:2', :target => '_self'} Critical
                  %li
                    %a{:href => '/events?sort=-age&limit=50&query=status:3', :target => '_self'} Unknown
              %li
                %a{:href => '/logout', :target => '_self'} Logout
            - else
              %li 
                %a{:href => '/login', :target => '_self'} Login

      #content
        = yield

    #footer
      .copyright.text-center
        © Copyright 
        %a{:href => 'https://www.cloudant.com'} Cloudant, Inc.
        2014
        %a{:href => 'http://www.apache.org/licenses/LICENSE-2.0.html'} Apache License, Version 2.0
        %br
        %a{'data-toggle' => 'modal', 'data-target' => '#keyboard_shortcuts'} Keyboard Shortcuts

#keyboard_shortcuts.modal.fade
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{:type => 'button', 'data-dismiss' => 'modal', 'aria-hidden' => 'true'}
        %h3.modal-title Keyboard Shortcuts
      .modal-body
        %div
          %h4 Events
          %table.table.table-striped
            %tr
              %td Description
              %td Shortcut
            %tr
              %td Show keyboard shortcuts
              %td
                %span.well.well-sm ? (question mark)
            %tr
              %td Goto search query
              %td
                %span.well.well-sm . (period)
            %tr
              %td Select the sort dropdown
              %td
                %span.well.well-sm s
            %tr
              %td Press search button
              %td
                %span.well.well-sm enter
      .modal-footer
        %button.btn.btn-default{:type => 'button', 'data-dismiss' => 'modal'} Close
